package com.example.demo.design.command;

import cn.hutool.core.lang.Func;

import java.sql.SQLOutput;

/**
 * @Author: liull
 * @Description:
 * @Date: Created in 11:20 2021/4/6
 * @Modified By:
 */
public class FunctionButton {
    /**
     * 功能键名称
     */

    private String name;

    /**
     * 维持一个对抽象命令类的引用
     */
    private Command command;

    public FunctionButton(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }

    public void setCommand(Command command) {
        this.command = command;
    }

    /**
     * 发送请求的方法
     */
    public void onClick() {
        System.out.println("点击功能键：");
        command.execute();
    }
}
